<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | Dashboard</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="../bower_components/Ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
    <!-- Morris chart -->
    <link rel="stylesheet" href="../bower_components/morris.js/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="../bower_components/jvectormap/jquery-jvectormap.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="../bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="../bower_components/bootstrap-daterangepicker/daterangepicker.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <header class="main-header">
        <!-- Logo -->
        <a href="index2.html" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>A</b>LT</span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>Diploam</b>System</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- Notifications: style can be found in dropdown.less -->
                    <!-- Notifications: style can be found in dropdown.less -->
                    <li class="dropdown notifications-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-bell-o"></i>
                            <span class="label label-warning" id="warning"
                                  th:text="${applyAccount}"></span>
                        </a>
                        <ul class="dropdown-menu ">
                            <li class="header" th:text="${applyAccount}+'个学历申请待确认'"></li>
                            <li>
                                <!-- inner menu: contains the actual data -->
                                <ul class="menu" th:each="a:${applies}">
                                    <li>
                                        <a href="#">
                                            <i class="fa fa-warning text-yellow"></i>
                                            <span th:text="'申请信息：专业--'+${a.getMajor()}+'学位--'+${a.getEduType()}"></span>
                                        </a>
                                    </li>
                                </ul>
                            </li>
                            <li class="footer"><a href="#">View all</a></li>
                        </ul>
                    </li>
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="../dist/img/Admin.jpg" class="user-image" alt="User Image">
                            <span class="hidden-xs">Admin</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- User image -->
                            <li class="user-header">
                                <img src="../dist/img/Admin.jpg" class="img-circle" alt="User Image">

                                <p>
                                    Admin
                                    <small>manager for Diploma System</small>
                                </p>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-right">
                                    <a href="/admin/SignOut" class="btn btn-default btn-flat">Sign out</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="../dist/img/Admin.jpg" class="img-circle" alt="User Image">
                    <!--          <img src="../static/dist/img/tourist.jpeg" class="img-circle" alt="User Image">-->
                </div>
                <div class="pull-left info">
                    <p>Admin</p>
                    <!--          <a href="#"><i class="fa fa-circle text-danger"></i> Offline</a>-->
                    <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                </div>
            </div>
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu" data-widget="tree">
                <li class="header">管理员模块</li>
                <li class="treeview">
                    <a href="#">
                        <i class="glyphicon glyphicon-home"></i> <span>主 页</span>
                        <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/admin"><i class="fa fa-circle-o"></i>用户大厅</a></li>
                        <li><a href="/student/search"><i class="fa fa-circle-o"></i>学历查询</a></li>
                    </ul>
                </li>
                <li class="treeview">
                    <a href="#">
                        <i class="glyphicon glyphicon-list-alt"></i> <span>黑名单</span>
                        <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/admin/listBlackList"><i class="fa fa-circle-o"></i>黑名单列表</a></li>
                        <li><a href="/admin/addBlackList"><i class="fa fa-circle-o"></i>添加黑名单</a></li>
                    </ul>
                </li>
                <li class="treeview">
                    <a href="#">
                        <i class="glyphicon glyphicon-retweet"></i> <span>确认学历</span>
                        <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/admin/comfirmEdu"><i class="fa fa-circle-o"></i>待确认学历</a></li>
                    </ul>
                </li>
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Diploma System
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Admin</a></li>
                <li class="active">添加黑名单</li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="box box-info">
                <div class="box-header with-border">
                    <h3 class="box-title">需要添加的黑名单:</h3>
                </div>
            <div  id="BlackListTableDiv">
                <form action="javascript:void(0)"  class="form-horizontal" id="addblt" role="form">
                    <div class="form-group">
                        <label for="showIndex" class="col-sm-2 control-label">Index</label>
                        <div class="col-sm-10">
                        <input class="form-control" id="showIndex" name="index" th:value="${bltAccount}" readonly="readonly"  type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="showName" class="col-sm-2 control-label">用户姓名</label>
                        <div class="col-sm-10">
                        <input class="form-control" id="showName" name="name"  type="text" placeholder="输入姓名"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="showSid" class="col-sm-2 control-label">用户学号</label>
                        <div class="col-sm-10">
                        <input class="form-control" id="showSid" name="sid" placeholder="输入学号"  type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="showSchool" class="col-sm-2 control-label">用户学校</label>
                        <div class="col-sm-10">
                        <input class="form-control" id="showSchool" name="school" placeholder="输入学校" type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="showAddress" class="col-sm-2 control-label">用户ID</label>
                        <div class="col-sm-10">
                        <input class="form-control" id="showAddress" name="id" placeholder="输入ID"  type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="showReason" class="col-sm-2 control-label">原因</label>
                        <div class="col-sm-10">
                        <input class="form-control" id="showReason" name="reason" placeholder="输入原因"   type="text"/>
                        </div>
                    </div>
                </form>
                <div class="modal-footer">
                    <button class="btn btn-warning" id="add" type="button">添加</button>
                </div>
            </div>
            </div>
        </section>
    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 0.0.1
        </div>
<!--        <strong>DiplomaSystem@wust 2020&#45;&#45;毕业设计</strong> By Aiden.徐险-->
    </footer>

</div>

<!-- jQuery 3 -->
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="../bower_components/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- DataTables -->
<script src="../bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="../bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="../bower_components/raphael/raphael.min.js"></script>
<!-- Sparkline -->
<script src="../bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="../plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="../bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="../bower_components/moment/min/moment.min.js"></script>
<script src="../bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="../bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- Slimscroll -->
<script src="../bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/adminlte.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="../dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<script>
    $(document).ready(function () {
        $('#add').click(function () {
            var msg = "你确定要添加吗";
            if (confirm(msg) == true) {
                var updateData = $("#addblt").serializeArray();
                var data = "{";
                for (var i = 0; i < updateData.length; i++) {
                    var name = updateData[i].name;
                    var value = updateData[i].value;
                    data = data + "\"" + name + "\":\"" + value.trim() + "\",";
                }
                data = data.substring(0, data.length - 1);
                data = data + "}";
                console.log(data);
                $.ajax({
                    url: "/admin/addblt",
                    contentType: 'application/json',
                    dataType: "json",
                    type: "post",
                    data: data,
                    success: function (status) {
                        if (status.code == 1) {
                            alert("add success");
                            window.location.replace("/admin");
                        } else {
                            alert("add failed");
                        }
                    },
                    error: function (data) {
                        $('#deleteModel').modal('hide');
                        alert("add ok");
                        window.location.replace("/admin");
                    }
                });
            }
        });
    })
</script>
</body>
</html>
